DROP TABLE CRST_AR_CASH_RECEIPTS_ALL;
 
CREATE TABLE CRST_AR_CASH_RECEIPTS_ALL                                                                                                                            
(                                                                                                                                                            
  CASH_RECEIPT_ID                 NUMBER(15)    NOT NULL,                                                                                                    
  LAST_UPDATED_BY                 NUMBER(15)    NOT NULL,                                                                                                    
  LAST_UPDATE_DATE                DATE          NOT NULL,                                                                                                    
  LAST_UPDATE_LOGIN               NUMBER(15),                                                                                                                
  CREATED_BY                      NUMBER(15)    NOT NULL,                                                                                                    
  CREATION_DATE                   DATE          NOT NULL,                                                                                                    
  AMOUNT                          NUMBER        NOT NULL,                                                                                                    
  SET_OF_BOOKS_ID                 NUMBER(15)    NOT NULL,                                                                                                    
  CURRENCY_CODE                   VARCHAR2(15 BYTE) NOT NULL,                                                                                                
  RECEIVABLES_TRX_ID              NUMBER(15),                                                                                                                
  PAY_FROM_CUSTOMER               NUMBER(15),                                                                                                                
  STATUS                          VARCHAR2(30 BYTE),                                                                                                         
  TYPE                            VARCHAR2(20 BYTE),                                                                                                         
  RECEIPT_NUMBER                  VARCHAR2(30 BYTE),                                                                                                         
  RECEIPT_DATE                    DATE          NOT NULL,                                                                                                    
  MISC_PAYMENT_SOURCE             VARCHAR2(30 BYTE),                                                                                                         
  COMMENTS                        VARCHAR2(240 BYTE),                                                                                                        
  DISTRIBUTION_SET_ID             NUMBER(15),                                                                                                                
  REVERSAL_DATE                   DATE,                                                                                                                      
  REVERSAL_CATEGORY               VARCHAR2(20 BYTE),                                                                                                         
  REVERSAL_REASON_CODE            VARCHAR2(30 BYTE),                                                                                                         
  REVERSAL_COMMENTS               VARCHAR2(240 BYTE),                                                                                                        
  EXCHANGE_RATE_TYPE              VARCHAR2(30 BYTE),                                                                                                         
  EXCHANGE_RATE                   NUMBER,                                                                                                                    
  EXCHANGE_DATE                   DATE,                                                                                                                      
  ATTRIBUTE_CATEGORY              VARCHAR2(30 BYTE),                                                                                                         
  ATTRIBUTE1                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE2                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE3                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE4                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE5                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE6                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE7                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE8                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE9                      VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE10                     VARCHAR2(150 BYTE),                                                                                                        
  REMITTANCE_BANK_ACCOUNT_ID      NUMBER(15),                                                                                                                
  ATTRIBUTE11                     VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE12                     VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE13                     VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE14                     VARCHAR2(150 BYTE),                                                                                                        
  ATTRIBUTE15                     VARCHAR2(150 BYTE),                                                                                                        
  CONFIRMED_FLAG                  VARCHAR2(1 BYTE),                                                                                                          
  CUSTOMER_BANK_ACCOUNT_ID        NUMBER(15),                                                                                                                
  CUSTOMER_SITE_USE_ID            NUMBER(15),                                                                                                                
  DEPOSIT_DATE                    DATE,                                                                                                                      
  PROGRAM_APPLICATION_ID          NUMBER(15),                                                                                                                
  PROGRAM_ID                      NUMBER(15),                                                                                                                
  PROGRAM_UPDATE_DATE             DATE,                                                                                                                      
  RECEIPT_METHOD_ID               NUMBER(15)    NOT NULL,                                                                                                    
  REQUEST_ID                      NUMBER(15),                                                                                                                
  SELECTED_FOR_FACTORING_FLAG     VARCHAR2(1 BYTE),                                                                                                          
  SELECTED_REMITTANCE_BATCH_ID    NUMBER(15),                                                                                                                
  FACTOR_DISCOUNT_AMOUNT          NUMBER,                                                                                                                    
  USSGL_TRANSACTION_CODE          VARCHAR2(30 BYTE),                                                                                                         
  USSGL_TRANSACTION_CODE_CONTEXT  VARCHAR2(30 BYTE),                                                                                                         
  DOC_SEQUENCE_VALUE              NUMBER(15),                                                                                                                
  DOC_SEQUENCE_ID                 NUMBER(15),                                                                                                                
  VAT_TAX_ID                      NUMBER(15),                                                                                                                
  REFERENCE_TYPE                  VARCHAR2(30 BYTE),                                                                                                         
  REFERENCE_ID                    NUMBER(15),                                                                                                                
  CUSTOMER_RECEIPT_REFERENCE      VARCHAR2(30 BYTE),                                                                                                         
  OVERRIDE_REMIT_ACCOUNT_FLAG     VARCHAR2(1 BYTE),                                                                                                          
  ORG_ID                          NUMBER(15),
  ANTICIPATED_CLEARING_DATE       DATE,                                                                                                                      
  GLOBAL_ATTRIBUTE1               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE2               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE3               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE4               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE5               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE6               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE7               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE8               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE9               VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE10              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE11              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE12              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE13              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE14              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE15              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE16              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE17              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE18              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE19              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE20              VARCHAR2(150 BYTE),                                                                                                        
  GLOBAL_ATTRIBUTE_CATEGORY       VARCHAR2(30 BYTE),                                                                                                         
  ISSUER_NAME                     VARCHAR2(50 BYTE),                                                                                                         
  ISSUE_DATE                      DATE,                                                                                                                      
  ISSUER_BANK_BRANCH_ID           NUMBER(15),                                                                                                                
  CUSTOMER_BANK_BRANCH_ID         NUMBER(15),                                                                                                                
  MRC_EXCHANGE_RATE_TYPE          VARCHAR2(2000 BYTE),                                                                                                       
  MRC_EXCHANGE_RATE               VARCHAR2(2000 BYTE),                                                                                                       
  MRC_EXCHANGE_DATE               VARCHAR2(2000 BYTE),                                                                                                       
  PAYMENT_SERVER_ORDER_NUM        VARCHAR2(80 BYTE),                                                                                                         
  APPROVAL_CODE                   VARCHAR2(80 BYTE),                                                                                                         
  ADDRESS_VERIFICATION_CODE       VARCHAR2(80 BYTE),                                                                                                         
  TAX_RATE                        NUMBER,                                                                                                                    
  ACTUAL_VALUE_DATE               DATE,                                                                                                                      
  POSTMARK_DATE                   DATE,                                                                                                                      
  APPLICATION_NOTES               VARCHAR2(2000 BYTE),
  CASH_RECEIPT_ID_N               NUMBER(15)                                                                                                        
);
